package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacGermDict;
import com.ysd.lis.entity.lab.LabProcessSet;
import com.ysd.lis.request.ProcessDto;
import com.ysd.lis.request.DeleteParam;
import com.ysd.lis.service.lab.LabProcessSetService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 流程设定主表 前端控制器
 * </p>
 *
 * @author bai
 * @since 2024-02-19
 */
@RestController
@RequestMapping("/lab/process/set")
public class LabProcessSetController extends BaseController {

    @Autowired
    LabProcessSetService processSetService;

    //获取流程节点信息列表
    @ApiOperation("获取流程节点信息列表（不分页)")
    @GetMapping("/getProcessSetList")
    public Result getProcessSetList(LabProcessSet labProcessSet) {
        return processSetService.getProcessSetList(labProcessSet);
    }

    @ApiOperation("删除标本流程节点信息")
    @PostMapping("/daleteProcess")
    @LogDetail(requestParam = "daleteProcess", operationType = OperationType.DELETE, module = "条码管理", content = "通过检验模块，使用流程设置功能删除了：【names】流程节点")
    public Result daleteProcess(@RequestBody ProcessDto deleteParam) {
        return processSetService.daleteProcess(deleteParam);
    }

    //修改(废弃)
    @ApiOperation("修改标本流程节点信息")
    @PostMapping("/updateProcess")
    @LogDetail(requestParam = "updateProcess", operationType = OperationType.UPDATE, module = "条码管理", content = "通过检验模块，使用流程设置功能修改了：【nodeNames】流程节点")
    public Result updateProcess(@RequestBody ProcessDto processDto) {
        return processSetService.updateProcess(processDto);
    }

    //新增(废弃)
    @ApiOperation("新增标本流程节点")
    @PostMapping("/addProcess")
    @LogDetail(requestParam = "addProcess", operationType = OperationType.INSERT, module = "条码管理", content = "通过检验模块，使用流程设置功能新增了：【nodeNames】流程节点")
    public Result addProcess(@RequestBody ProcessDto processDto) {
        return processSetService.addProcess(processDto);
    }

    @ApiOperation("新增标本流程节点")
    @PostMapping("/addProcessInfo")
    public Result addProcessInfo(@RequestBody LabProcessSet processSet) {
        return processSetService.addProcessInfo(processSet);
    }

    @ApiOperation("修改标本流程节点信息")
    @PostMapping("/updateProcessInfo")
    public Result updateProcessInfo(@RequestBody LabProcessSet processSet) {
        return processSetService.updateProcessInfo(processSet);
    }

    //获取流程节点信息列表
    @ApiOperation("根据节点code获取流程节点属性信息列表（不分页)")
    @GetMapping("/getNodeListByCode")
    public Result getNodeListByCode(String  code) {
        return processSetService.getNodeListByCode(code);
    }

}
